package com.jxj.entity;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name="demand")
public class Demand {
	@Id
	@GeneratedValue(generator = "xxx")    
	@GenericGenerator(name = "xxx", strategy = "assigned")  
	private int id ;
	@Column(name="content")
	private String content;//内容
	
	@Column(name="type")
	private String type;//类型(即是快递 还是 送吃的)
	
	@Column(name="price")
	private double price;//价格
	
	@Column(name="img")
	private String img;//图片
	
	@Column(name="people")
	private String people;//需求对象
	
	
	@Column(name="accept")
	private boolean accept;//是否被接受
	
	
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public String getImg() {
		return img;
	}
	public void setImg(String img) {
		this.img = img;
	}
	public String getPeople() {
		return people;
	}
	public void setPeople(String people) {
		this.people = people;
	}
	public boolean isAccept() {
		return accept;
	}
	public void setAccept(boolean accept) {
		this.accept = accept;
	}
	@OneToOne(mappedBy="demand")
	private Receive receive;
	public Receive getReceive() {
		return receive;
	}
	public void setReceive(Receive receive) {
		this.receive = receive;
	}
	@ManyToOne
	@JoinColumn(name="udid")
	private User user;
	
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	@Override
	public String toString() {
		return "Demand [id=" + id + ", content=" + content + ", type=" + type + ", price=" + price + ", img=" + img
				+ ", people=" + people + ", accept=" + accept + ", receive=" + receive + ", user=" + user + "]";
	}

	
	
	
	
}
